package jvs.sh;

import jvs.peer.io.File;
import jvs.peer.sec.User;

public class LocalShell extends Shell {
	private CommandInterpreter ci;
	private User user = ROOTUSER;
	public LocalShell() {
		init();
	}

	public void init() {
		super.init();
		//
		ci = new CommandInterpreter();
		ci.setShell(this);
	}

	@Override
	public void ensureAdmin() {
		return;
	}

	@Override
	public void ensureUser() {
		return;
	}

	@Override
	public void checkAuth(File f) {
		return;
	}

	@Override
	protected boolean isAuth(File f) {
		return true;
	}

	@Override
	public void abort() throws Exception {
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Override
	public User getUser() {
		return user;
	}

	@Override
	public void exit() {

	}

	public void setConsole(Console console) {
		ci.setConsole(console);
	}

	@Override
	public boolean isConnected() {
		return true;
	}

	@Override
	public boolean isVerbose() {
		return false;
	}

	public void parse(String s) {
		ci.parse(s);
	}
}
